package Song.Han.day04.demo05;

import java.util.ArrayList;
import java.util.Random;

/*
* 题目：
*   生成6个1~33的随机整数，添加到集合，并遍历集合*/
public class Demo01ArrayListRandom {
    public static void main(String[] args) {
        ArrayList<Integer> list1 = new ArrayList<>();
        Random r = new Random();

        for (int i = 0; i < 6; i++) {
            list1.add(r.nextInt(33)+1);
        }

        System.out.println(list1);

        for (int i = 0; i < list1.size(); i++) {
            System.out.print(list1.get(i)+" ");
        }
    }
}
